package com.blq.web.CustomerRepair.service;

import com.alibaba.fastjson.JSONObject;
import com.blq.common.utils.ResultMsg;
import com.blq.web.CustomerRepair.domain.CustomerRepair;
import com.blq.web.CustomerRepair.domain.vo.CustomerRepairVo;
import com.blq.web.CustomerRepair.domain.bo.CustomerRepairBo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blq.common.core.page.TableDataInfo;
import com.blq.common.core.domain.PageQuery;
import com.blq.web.customerMode.entiy.TrendChartDto;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 客户报修抢修Service接口
 *
 * @author Blq
 * @date 2022-08-31
 */
public interface ICustomerRepairService extends IService<CustomerRepair> {

    List<Map<String,Object>> selectSalesVolume(TrendChartDto trendChart);

    List<Map<String,Object>> selectReceiveNum(TrendChartDto trendChart);

    List<Map<String,Object>> selectUserOrderAndPrice(TrendChartDto trendChart);

    List<CustomerRepair> queryPendingOrder(JSONObject jsonObject);

    List<CustomerRepair> queryByUserIdAndStatus(JSONObject jsonObject);

    List<CustomerRepair> viewAllUserOrders(JSONObject jsonObject);

    List<CustomerRepair> selectByCustomerRepair(CustomerRepair customerRepair, PageQuery pageQuery);

    Map<String,Object> queryVariousOrders(JSONObject jsonObject);

    /**
     * 查询客户报修抢修
     */
    CustomerRepairVo queryById(String customerKey);

    /**
     * 查询客户报修抢修列表
     */
    TableDataInfo<CustomerRepairVo> queryPageList(CustomerRepairBo bo, PageQuery pageQuery);

    /**
     * 查询客户报修抢修列表
     */
    List<CustomerRepairVo> queryList(CustomerRepairBo bo);

    /**
     * 修改客户报修抢修
     */
    Boolean insertByBo(CustomerRepairBo bo);

    /**
     * 修改客户报修抢修
     */
    Boolean updateByBo(CustomerRepairBo bo);

    /**
     * 校验并批量删除客户报修抢修信息
     */
    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);
    /**
     * @Description 接口描述 :
     * @Params  * @param null
     *      customerKey : 订单的主键号码
     *      customer_player  :  选择师傅ids
     *      orderStatus : 修改订单状态码
     *      loginmanId : 当前登录人 id
     * @Return
     * @Author xiaw
     * @Date 2022/12/25 0:13
     */
    ResultMsg updateWorkOrderStatus(JSONObject jsonObject);

    Map<String,Object> queryServedCustomerData(String date) throws Exception;


    void updateNotice(String loginmanId,
                      String customerKey,
                      String remark,
                      String content,
                      String user,//用户状态
                      String worker,//工人
                      String Audit,//审核
                      String Finance);

    void timeoutToOrderPool();

    @Transactional
    void workerOnSitePayment(String orderId);

    void toPayoffOrder();

    @Transactional
    void payoffOrder(String orderId);

    void orderPayment();
}
